Replace deprecated rdfjs-wrapper with @rdfjs/wrapper#16
Merged
Conversation
Migrate from the deprecated `rdfjs-wrapper` package to the new `@rdfjs/wrapper` namespace. Update all import statements and adapt to the new API: - ValueMappings.literalToString → LiteralAs.string - ValueMappings.iriToString → NamedNodeAs.string - ValueMappings.literalToDate → LiteralAs.date - ValueMappings.literalToNumber → LiteralAs.number - TermMappings.stringToLiteral → LiteralFrom.string - TermMappings.stringToIri → NamedNodeFrom.string - TermWrapper.as(Class) → TermAs.instance(Class) - TermFrom.instance for "from" mappings in objects() - this.term.value → this.value (inherited from AnyTerm) Agent-Logs-Url: https://github.com/solid/object/sessions/d7aba86d-a254-4824-9e3d-05deaee579b9 Co-authored-by: jeswr <63333554+jeswr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update rdfjs wrapper to use @rdfjs/wrapper
Replace deprecated Apr 4, 2026
rdfjs-wrapper with @rdfjs/wrapper
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the codebase from the deprecated rdfjs-wrapper package to @rdfjs/wrapper, updating imports and term/value mapping APIs accordingly so RDFJS term wrappers keep working with the maintained library.
Changes:
- Replaced
rdfjs-wrapperdependency with@rdfjs/wrapper. - Updated mapping utilities usage (e.g.,
ValueMappings.*→LiteralAs/NamedNodeAs,TermMappings.*→*From,TermWrapper.as()→TermAs.instance()/TermFrom.instance). - Updated usages of
.term.valueto.valuewhere applicable and adjusted unit test expectations.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/example.test.ts | Updates assertion to use wrapper .value instead of .term.value. |
| src/webid/WebIdDataset.ts | Switches DatasetWrapper import to @rdfjs/wrapper. |
| src/webid/Agent.ts | Migrates term/value mappings and .value accessors for Agent-related fields. |
| src/solid/TelephoneDataset.ts | Switches DatasetWrapper import to @rdfjs/wrapper. |
| src/solid/Telephone.ts | Migrates literal/IRI mappings to LiteralAs/LiteralFrom/NamedNodeAs/NamedNodeFrom. |
| src/solid/Resource.ts | Migrates mappings and uses wrapper .value for resource ID. |
| src/solid/EmailDataset.ts | Switches DatasetWrapper import to @rdfjs/wrapper. |
| src/solid/Email.ts | Migrates literal/IRI mappings to LiteralAs/LiteralFrom/NamedNodeAs/NamedNodeFrom. |
| src/solid/ContainerDataset.ts | Switches DatasetWrapper import to @rdfjs/wrapper. |
| src/solid/Container.ts | Migrates wrapper class mapping to TermAs.instance + TermFrom.instance. |
| src/acp/Typed.ts | Migrates rdf:type mapping to NamedNodeAs/NamedNodeFrom. |
| src/acp/Policy.ts | Migrates allow/anyOf mappings to @rdfjs/wrapper APIs. |
| src/acp/Matcher.ts | Migrates agent mapping to NamedNodeAs/NamedNodeFrom. |
| src/acp/AcrDataset.ts | Switches DatasetWrapper import to @rdfjs/wrapper. |
| src/acp/AccessControlResource.ts | Migrates access control/resource mappings to new mapping APIs. |
| src/acp/AccessControl.ts | Migrates policy mapping to TermAs.instance + TermFrom.instance. |
| package.json | Replaces dependency rdfjs-wrapper with @rdfjs/wrapper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rdfjs-wrapperis deprecated in favor of@rdfjs/wrapper. This migrates to the new package and adapts to its updated API.Dependency change
rdfjs-wrapper@^0.15.0→@rdfjs/wrapper@^0.32.0API migration
The new package restructures mapping utilities into namespaced exports:
ValueMappings.literalToStringLiteralAs.stringValueMappings.iriToStringNamedNodeAs.stringValueMappings.literalToDateLiteralAs.dateValueMappings.literalToNumberLiteralAs.numberTermMappings.stringToLiteralLiteralFrom.stringTermMappings.stringToIriNamedNodeFrom.stringTermWrapper.as(Class)TermAs.instance(Class)/TermFrom.instancethis.term.valuethis.valueExample:
Note:
TermAs.instance(Class)is a factory returning a mapping, whileTermFrom.instanceis the mapping function itself — it extracts the underlyingTermfrom anyTermWrapperregardless of subclass.